package com.uml.umlwork.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.uml.umlwork.entity.Class;
import com.uml.umlwork.vo.clazz.ClassTeacherVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;


@Repository
@Mapper
public interface ClassMapper extends BaseMapper<Class> {

    /**
     * 根据课程ID获取开课班
     * @param courseId 课程ID
     * @return
     */
    List<Class> getAllClassesByCourseId(Integer courseId);

    Page<ClassTeacherVO> getClassByTeacherId(IPage<Class> page, @Param(Constants.WRAPPER) Wrapper<Class> eq);
}
